<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 6.1.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"chenmenghui.gitee.io","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":true,"scrollpercent":true},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":false,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="HTTP&#x2F;1.1中 HTTP协议状态码 五类响应: 1xx,2xx,3xx,4xx,5xx    代码 含义    1**(信息类) 表示接收到请求并且继续处理   100 客户必须继续发出请求   101 客户要求服务器根据请求转换HTTP协议版本       2**(响应成功) 表示动作被成功接收、理解和接受   200 表明该请求被成功地完成，所请求的资源发送回客户端   201">
<meta property="og:type" content="article">
<meta property="og:title" content="PHP基础知识之网络协议">
<meta property="og:url" content="https://chenmenghui.gitee.io/posts/64186.html">
<meta property="og:site_name" content="陈孟辉的学习笔记">
<meta property="og:description" content="HTTP&#x2F;1.1中 HTTP协议状态码 五类响应: 1xx,2xx,3xx,4xx,5xx    代码 含义    1**(信息类) 表示接收到请求并且继续处理   100 客户必须继续发出请求   101 客户要求服务器根据请求转换HTTP协议版本       2**(响应成功) 表示动作被成功接收、理解和接受   200 表明该请求被成功地完成，所请求的资源发送回客户端   201">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2018-09-05T16:00:00.000Z">
<meta property="article:modified_time" content="2022-04-15T05:54:44.999Z">
<meta property="article:author" content="陈孟辉">
<meta property="article:tag" content="PHP基础知识">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://chenmenghui.gitee.io/posts/64186.html">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>PHP基础知识之网络协议 | 陈孟辉的学习笔记</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/rss2.xml" title="陈孟辉的学习笔记" type="application/rss+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">陈孟辉的学习笔记</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">加油吧骚年</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-rss">

    <a href="/rss2.xml" rel="section"><i class="fa fa-rss fa-fw"></i>RSS</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://chenmenghui.gitee.io/posts/64186.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="陈孟辉">
      <meta itemprop="description" content="日积月藏，不做咸鱼。这里是陈孟辉的个人学习笔记，现就职于北京瑞友科技，负责维护企业ERP系统。">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="陈孟辉的学习笔记">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          PHP基础知识之网络协议
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2018-09-06 00:00:00" itemprop="dateCreated datePublished" datetime="2018-09-06T00:00:00+08:00">2018-09-06</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2022-04-15 13:54:44" itemprop="dateModified" datetime="2022-04-15T13:54:44+08:00">2022-04-15</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/PHP/" itemprop="url" rel="index"><span itemprop="name">PHP</span></a>
                </span>
                  ，
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/PHP/PHP%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/" itemprop="url" rel="index"><span itemprop="name">PHP基础知识</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/posts/64186.html#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/posts/64186.html" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>5.2k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>5 分钟</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>HTTP&#x2F;1.1中</p>
<p>HTTP协议状态码</p>
<p>五类响应: 1xx,2xx,3xx,4xx,5xx</p>
<table>
<thead>
<tr>
<th>代码</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>1**(信息类)</td>
<td>表示接收到请求并且继续处理</td>
</tr>
<tr>
<td>100</td>
<td>客户必须继续发出请求</td>
</tr>
<tr>
<td>101</td>
<td>客户要求服务器根据请求转换HTTP协议版本</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>2**(响应成功)</td>
<td>表示动作被成功接收、理解和接受</td>
</tr>
<tr>
<td>200</td>
<td>表明该请求被成功地完成，所请求的资源发送回客户端</td>
</tr>
<tr>
<td>201</td>
<td>提示知道新文件的URL</td>
</tr>
<tr>
<td>202</td>
<td>接受和处理、但处理未完成</td>
</tr>
<tr>
<td>203</td>
<td>返回信息不确定或不完整</td>
</tr>
<tr>
<td>204</td>
<td>请求收到，但返回信息为空</td>
</tr>
<tr>
<td>205</td>
<td>服务器完成了请求，用户代理必须复位当前已经浏览过的文件</td>
</tr>
<tr>
<td>206</td>
<td>服务器已经完成了部分用户的GET请求</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>3**(重定向类)</td>
<td>为了完成指定的动作，必须接受进一步处理</td>
</tr>
<tr>
<td>300</td>
<td>请求的资源可在多处得到</td>
</tr>
<tr>
<td>301</td>
<td>本网页被永久性转移到另一个URL</td>
</tr>
<tr>
<td>302</td>
<td>请求的网页被转移到一个新的地址，但客户访问仍继续通过原始URL地址，重定向，新的URL会在response中的Location中返回，浏览器将会使用新的URL发出新的Request。</td>
</tr>
<tr>
<td>303</td>
<td>建议客户访问其他URL或访问方式</td>
</tr>
<tr>
<td>304</td>
<td>自从上次请求后，请求的网页未修改过，服务器返回此响应时，不会返回网页内容，代表上次的文档已经被缓存了，还可以继续使用</td>
</tr>
<tr>
<td>305</td>
<td>请求的资源必须从服务器指定的地址得到</td>
</tr>
<tr>
<td>306</td>
<td>前一版本HTTP中使用的代码，现行版本中不再使用</td>
</tr>
<tr>
<td>307</td>
<td>申明请求的资源临时性删除</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>4**(客户端错误类)</td>
<td>请求包含错误语法或不能正确执行</td>
</tr>
<tr>
<td>400</td>
<td>客户端请求有语法错误，不能被服务器所理解</td>
</tr>
<tr>
<td>401</td>
<td>请求未经授权，这个状态代码必须和WWW-Authenticate报头域一起使用</td>
</tr>
<tr>
<td>401.2</td>
<td>未授权  服务器配置问题导致登录失败</td>
</tr>
<tr>
<td>401.3</td>
<td>ACL 禁止访问资源</td>
</tr>
<tr>
<td>401.4</td>
<td>未授权 授权被筛选器拒绝</td>
</tr>
<tr>
<td>401.5</td>
<td>未授权 ISAPI 或 CGI 授权失败</td>
</tr>
<tr>
<td>402</td>
<td>保留有效ChargeTo头响应</td>
</tr>
<tr>
<td>403</td>
<td>禁止访问，服务器收到请求，但是拒绝提供服务</td>
</tr>
<tr>
<td>403.1</td>
<td>禁止访问 禁止可执行访问</td>
</tr>
<tr>
<td>403.2</td>
<td>禁止访问 禁止读访问</td>
</tr>
<tr>
<td>403.3</td>
<td>禁止访问 禁止写访问</td>
</tr>
<tr>
<td>403.4</td>
<td>禁止访问 要求 SSL</td>
</tr>
<tr>
<td>403.5</td>
<td>禁止访问 要求 SSL 128</td>
</tr>
<tr>
<td>403.6</td>
<td>禁止访问 IP 地址被拒绝</td>
</tr>
<tr>
<td>403.7</td>
<td>禁止访问 要求客户证书</td>
</tr>
<tr>
<td>403.8</td>
<td>禁止访问 禁止站点访问</td>
</tr>
<tr>
<td>403.9</td>
<td>禁止访问 连接的用户过多</td>
</tr>
<tr>
<td>403.10</td>
<td>禁止访问 配置无效</td>
</tr>
<tr>
<td>403.11</td>
<td>禁止访问 密码更改</td>
</tr>
<tr>
<td>403.12</td>
<td>禁止访问 映射器拒绝访问</td>
</tr>
<tr>
<td>403.13</td>
<td>禁止访问 客户证书已被吊销</td>
</tr>
<tr>
<td>403.15</td>
<td>禁止访问 客户访问许可过多</td>
</tr>
<tr>
<td>403.16</td>
<td>禁止访问 客户证书不可信或者无效</td>
</tr>
<tr>
<td>403.17</td>
<td>禁止访问 客户证书已经到期或者尚未生效</td>
</tr>
<tr>
<td>404</td>
<td>一个404错误表明可连接服务器，但服务器无法取得所请求的网页，请求资源不存在。eg  输入了错误的URL</td>
</tr>
<tr>
<td>405</td>
<td>用户在Request-Line字段定义的方法不允许</td>
</tr>
<tr>
<td>406</td>
<td>根据用户发送的Accept拖，请求资源不可访问</td>
</tr>
<tr>
<td>407</td>
<td>类似401，用户必须首先在代理服务器上得到授权</td>
</tr>
<tr>
<td>408</td>
<td>客户端没有在用户指定的饿时间内完成请求</td>
</tr>
<tr>
<td>409</td>
<td>对当前资源状态，请求不能完成</td>
</tr>
<tr>
<td>410</td>
<td>服务器上不再有此资源且无进一步的参考地址</td>
</tr>
<tr>
<td>411</td>
<td>服务器拒绝用户定义的Content-Length属性请求</td>
</tr>
<tr>
<td>412</td>
<td>一个或多个请求头字段在当前请求中错误</td>
</tr>
<tr>
<td>413</td>
<td>请求的资源大于服务器允许的大小</td>
</tr>
<tr>
<td>414</td>
<td>请求的资源URL长于服务器允许的长度</td>
</tr>
<tr>
<td>415</td>
<td>请求资源不支持请求项目格式</td>
</tr>
<tr>
<td>416</td>
<td>请求中包含Range请求头字段，在当前请求资源范围内没有range指示值，请求也不包含If-Range请求头字段</td>
</tr>
<tr>
<td>417</td>
<td>服务器不满足请求Expect头字段指定的期望值，如果是代理服务器，可能是下一级服务器不能满足请求长。</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>5**(服务端错误类)</td>
<td>服务器不能正确执行一个正确的请求</td>
</tr>
<tr>
<td>500</td>
<td>服务器遇到错误，无法完成请求</td>
</tr>
<tr>
<td>500.100</td>
<td>内部服务器错误 ASP 错误</td>
</tr>
<tr>
<td>500-11</td>
<td>服务器关闭</td>
</tr>
<tr>
<td>500-12</td>
<td>应用程序重新启动</td>
</tr>
<tr>
<td>500-13</td>
<td>服务器太忙</td>
</tr>
<tr>
<td>500-14</td>
<td>应用程序无效</td>
</tr>
<tr>
<td>500-15</td>
<td>不允许请求 global.asa</td>
</tr>
<tr>
<td>501</td>
<td>未实现</td>
</tr>
<tr>
<td>502</td>
<td>网关错误</td>
</tr>
<tr>
<td>503</td>
<td>由于超载或停机维护，服务器目前无法使用，一段时间后可能恢复正常</td>
</tr>
</tbody></table>
<p>延伸: OSI七层模型</p>
<ul>
<li>物理层<ul>
<li>建立,维护,断开物理连接</li>
</ul>
</li>
<li>数据链路层<ul>
<li>建立逻辑连接,进行硬件地址寻址,差错校验等功能</li>
</ul>
</li>
<li>网络层<ul>
<li>进行逻辑地址寻址,实现不同网络之间的路径选择</li>
</ul>
</li>
<li>传输层<ul>
<li>定义传输数据的协议端口号,以及流控和差错校验</li>
<li>协议有:TCP UDP,数据包一旦离开网卡即进入网络传输层</li>
</ul>
</li>
<li>会话层<ul>
<li>建立,管理,终止会话</li>
</ul>
</li>
<li>表示层<ul>
<li>数据的表示,安全和压缩</li>
</ul>
</li>
<li>应用层<ul>
<li>网络服务和最终用户的一个接口</li>
<li>协议有HTTPS,FTP等</li>
</ul>
</li>
</ul>
<p>延伸:HTTP协议的工作特点和工作原理</p>
<ul>
<li>工作特点<ul>
<li>基于B&#x2F;S模式</li>
<li>通信开销小,简单快速,传输成本低</li>
<li>使用灵活,可使用超文本传输协议</li>
<li>节省传输时间</li>
<li>无状态</li>
</ul>
</li>
<li>工作原理<ul>
<li>客户端发送请求给服务器,创建一个TCP连接,指定端口号(默认80),连接到服务器,服务器监听浏览器请求,一旦监听到客户端请求,分析请求类型后,服务器会想客户端返回状态信息和数据内容<br>延伸:HTTP协议常见请求&#x2F;响应头和请求方法</li>
</ul>
</li>
</ul>
<blockquote>
<p>常见请求&#x2F;响应头</p>
</blockquote>
<ul>
<li>Content-Type</li>
<li>Accept</li>
<li>Origin</li>
<li>Cookie</li>
<li>Cache-Control</li>
<li>User-Agent</li>
<li>Referrer</li>
<li>X-Forwarded-For</li>
<li>Access-Control-Allow-Origin</li>
<li>Last-Modified</li>
</ul>
<table>
<thead>
<tr>
<th>协议头</th>
<th>说明</th>
<th>示例</th>
<th>状态</th>
</tr>
</thead>
<tbody><tr>
<td>Accept-Encoding</td>
<td>可接受的响应内容的编码方式。</td>
<td><code>Accept-Encoding:gzip,deflate</code></td>
<td>固定</td>
</tr>
<tr>
<td>Accept-Language</td>
<td>可接受的响应内容语言列表。</td>
<td><code>Accept-Language:en-US</code></td>
<td>固定</td>
</tr>
<tr>
<td>Accept-Datetime</td>
<td>可接受的按照时间来表示的响应内容版本</td>
<td>Accept-Datetime:Sat,26Dec201517:30:00GMT</td>
<td>临时</td>
</tr>
<tr>
<td>Authorization</td>
<td>用于表示HTTP协议中需要认证资源的认证信息</td>
<td>Authorization:BasicOSdjJGRpbjpvcGVuIANlc2SdDE&#x3D;&#x3D;</td>
<td>固定</td>
</tr>
<tr>
<td>Cache-Control</td>
<td>用来指定当前的请求&#x2F;回复中的，是否使用缓存机制。</td>
<td><code>Cache-Control:no-cache</code></td>
<td>固定</td>
</tr>
<tr>
<td>Connection</td>
<td>客户端（浏览器）想要优先使用的连接类型</td>
<td><code>Connection:keep-alive</code><p><code>Connection:Upgrade</code></p></td>
<td>固定</td>
</tr>
<tr>
<td>Cookie</td>
<td>由之前服务器通过<code>Set-Cookie</code>（见下文）设置的一个HTTP协议Cookie</td>
<td><code>Cookie:$Version=1;Skin=new;</code></td>
<td>固定：标准</td>
</tr>
<tr>
<td>Content-Length</td>
<td>以8进制表示的请求体的长度</td>
<td><code>Content-Length:348</code></td>
<td>固定</td>
</tr>
<tr>
<td>Content-MD5</td>
<td>请求体的内容的二进制MD5散列值（数字签名），以Base64编码的结果</td>
<td>Content-MD5:oD8dH2sgSW50ZWdyaIEd9D&#x3D;&#x3D;</td>
<td>废弃</td>
</tr>
<tr>
<td>Content-Type</td>
<td>请求体的MIME类型（用于POST和PUT请求中）</td>
<td>Content-Type:application&#x2F;x-www-form-urlencoded</td>
<td>固定</td>
</tr>
<tr>
<td>Date</td>
<td>发送该消息的日期和时间（以&lt;ahref&#x3D;”<a href="http://tools.ietf.org/html/rfc7231#section-7.1.1.1&quot;rel=&quot;nofollow&quot;target=&quot;_blank&quot;&gt;RFC7231">http://tools.ietf.org/html/rfc7231#section-7.1.1.1&quot;rel=&quot;nofollow&quot;target=&quot;_blank&quot;&gt;RFC7231</a></a>中定义的”HTTP日期”格式来发送）</td>
<td>Date:Dec,26Dec201517:30:00GMT</td>
<td>固定</td>
</tr>
<tr>
<td>Expect</td>
<td>表示客户端要求服务器做出特定的行为</td>
<td><code>Expect:100-continue</code></td>
<td>固定</td>
</tr>
<tr>
<td>From</td>
<td>发起此请求的用户的邮件地址</td>
<td><code>From:<a href="mailto:&#x75;&#115;&#101;&#114;&#64;&#105;&#x74;&#98;&#x69;&#x6c;&#117;&#46;&#99;&#111;&#109;">&#x75;&#115;&#101;&#114;&#64;&#105;&#x74;&#98;&#x69;&#x6c;&#117;&#46;&#99;&#111;&#109;</a></code></td>
<td>固定</td>
</tr>
<tr>
<td>Host</td>
<td>表示服务器的域名以及服务器所监听的端口号。如果所请求的端口是对应的服务的标准端口（80），则端口号可以省略。</td>
<td><code>Host:<a target="_blank" rel="noopener" href="http://www.itbilu.com/">www.itbilu.com:80</a></code><p><code>Host:<a target="_blank" rel="noopener" href="http://www.itbilu.com/">www.itbilu.com</a></code></p></td>
<td>固定</td>
</tr>
<tr>
<td>If-Match</td>
<td>仅当客户端提供的实体与服务器上对应的实体相匹配时，才进行对应的操作。主要用于像PUT这样的方法中，仅当从用户上次更新某个资源后，该资源未被修改的情况下，才更新该资源。</td>
<td>If-Match:”9jd00cdj34pss9ejqiw39d82f20d0ikd”</td>
<td>固定</td>
</tr>
<tr>
<td>If-Modified-Since</td>
<td>允许在对应的资源未被修改的情况下返回304未修改</td>
<td>If-Modified-Since:Dec,26Dec201517:30:00GMT</td>
<td>固定</td>
</tr>
<tr>
<td>If-None-Match</td>
<td>允许在对应的内容未被修改的情况下返回304未修改（304NotModified），参考超文本传输协议的实体标记</td>
<td>If-None-Match:”9jd00cdj34pss9ejqiw39d82f20d0ikd”</td>
<td>固定</td>
</tr>
<tr>
<td>If-Range</td>
<td>如果该实体未被修改过，则向返回所缺少的那一个或多个部分。否则，返回整个新的实体</td>
<td>If-Range:”9jd00cdj34pss9ejqiw39d82f20d0ikd”</td>
<td>固定</td>
</tr>
<tr>
<td>If-Unmodified-Since</td>
<td>仅当该实体自某个特定时间以来未被修改的情况下，才发送回应。</td>
<td>If-Unmodified-Since:Dec,26Dec201517:30:00GMT</td>
<td>固定</td>
</tr>
<tr>
<td>Max-Forwards</td>
<td>限制该消息可被代理及网关转发的次数。</td>
<td><code>Max-Forwards:10</code></td>
<td>固定</td>
</tr>
<tr>
<td>Origin</td>
<td>发起一个针对&lt;ahref&#x3D;”<a href="http://itbilu.com/javascript/js/VkiXuUcC.html&quot;rel=&quot;nofollow&quot;target=&quot;_blank&quot;&gt;%E8%B7%A8%E5%9F%9F%E8%B5%84%E6%BA%90%E5%85%B1%E4%BA%AB">http://itbilu.com/javascript/js/VkiXuUcC.html&quot;rel=&quot;nofollow&quot;target=&quot;_blank&quot;&gt;跨域资源共享</a></a>的请求（该请求要求服务器在响应中加入一个<code>Access-Control-Allow-Origin</code>的消息头，表示访问控制所允许的来源）。</td>
<td><code>Origin:<a target="_blank" rel="noopener" href="http://www.itbilu.com/">http://www.itbilu.com</a></code></td>
<td>固定:标准</td>
</tr>
<tr>
<td>Pragma</td>
<td>与具体的实现相关，这些字段可能在请求&#x2F;回应链中的任何时候产生。</td>
<td><code>Pragma:no-cache</code></td>
<td>固定</td>
</tr>
<tr>
<td>Proxy-Authorization</td>
<td>用于向代理进行认证的认证信息。</td>
<td>Proxy-Authorization:BasicIOoDZRgDOi0vcGVuIHNlNidJi2&#x3D;&#x3D;</td>
<td>固定</td>
</tr>
<tr>
<td>Range</td>
<td>表示请求某个实体的一部分，字节偏移以0开始。</td>
<td><code>Range:bytes=500-999</code></td>
<td>固定</td>
</tr>
<tr>
<td>Referer</td>
<td>表示浏览器所访问的前一个页面，可以认为是之前访问页面的链接将浏览器带到了当前页面。<code>Referer</code>其实是<code>Referrer</code>这个单词，但RFC制作标准时给拼错了，后来也就将错就错使用<code>Referer</code>了。</td>
<td>Referer:<a target="_blank" rel="noopener" href="http://itbilu.com/nodejs">http://itbilu.com/nodejs</a></td>
<td>固定</td>
</tr>
<tr>
<td>TE</td>
<td>浏览器预期接受的传输时的编码方式：可使用回应协议头<code>Transfer-Encoding</code>中的值（还可以使用”trailers”表示数据传输时的分块方式）用来表示浏览器希望在最后一个大小为0的块之后还接收到一些额外的字段。</td>
<td><code>TE:trailers,deflate</code></td>
<td>固定</td>
</tr>
<tr>
<td>User-Agent</td>
<td>浏览器的身份标识字符串</td>
<td><code>User-Agent:Mozilla/……</code></td>
<td>固定</td>
</tr>
<tr>
<td>Upgrade</td>
<td>要求服务器升级到一个高版本协议。</td>
<td>Upgrade:HTTP&#x2F;2.0,SHTTP&#x2F;1.3,IRC&#x2F;6.9,RTA&#x2F;x11</td>
<td>固定</td>
</tr>
<tr>
<td>Via</td>
<td>告诉服务器，这个请求是由哪些代理发出的。</td>
<td>Via:1.0fred,1.1itbilu.com.com(Apache&#x2F;1.1)</td>
<td>固定</td>
</tr>
<tr>
<td>Warning</td>
<td>一个一般性的警告，表示在实体内容体中可能存在错误。</td>
<td>Warning:199Miscellaneouswarning</td>
<td>固定</td>
</tr>
</tbody></table>
<blockquote>
<p>请求方法</p>
</blockquote>
<p>get,post,head,options,put,delete,trace</p>
<p>get和post的区别</p>
<p>延伸:HTTPS协议的工作原理</p>
<p>HTTPS是一种基于ssl&#x2F;tls的http协议,所有的http数据都是在ssl&#x2F;tls协议封装之上传输的</p>
<p>HTTPs协议在http协议的基础上,添加了ssl&#x2F;tls握手以及数据加密传输,也属于应用层协议</p>
<p>延伸:常见网络协议含义及端口</p>
<ul>
<li>ftp 文件传输</li>
<li>telnet 远程登录</li>
<li>smtp 简单邮件传输协议</li>
<li>pop3 接收邮件</li>
<li>http 超文本传输协议</li>
<li>dns 用于域名解析</li>
</ul>
<hr>
<p><a target="_blank" rel="noopener" href="https://www.cnblogs.com/jianying/p/7992622.html">HTTP状态码大全</a><br><a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_30553235/article/details/79282113">常用的HTTP请求头与响应头</a></p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/PHP%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/" rel="tag"># PHP基础知识</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/posts/9091.html" rel="prev" title="PHP基础知识值面向对象">
      <i class="fa fa-chevron-left"></i> PHP基础知识值面向对象
    </a></div>
      <div class="post-nav-item">
    <a href="/posts/17036.html" rel="next" title="PHP基础知识之JavaScript和JQuery的基础考点">
      PHP基础知识之JavaScript和JQuery的基础考点 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">陈孟辉</p>
  <div class="site-description" itemprop="description">日积月藏，不做咸鱼。这里是陈孟辉的个人学习笔记，现就职于北京瑞友科技，负责维护企业ERP系统。</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">170</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">45</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">60</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title"><i class="fa fa-link fa-fw"></i>
      Links
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="http://tool.oschina.net/uploads/apidocs/jquery/regexp.html" title="http:&#x2F;&#x2F;tool.oschina.net&#x2F;uploads&#x2F;apidocs&#x2F;jquery&#x2F;regexp.html" rel="noopener" target="_blank">正则表达式</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://www.cs.usfca.edu/~galles/visualization/Algorithms.html" title="https:&#x2F;&#x2F;www.cs.usfca.edu&#x2F;~galles&#x2F;visualization&#x2F;Algorithms.html" rel="noopener" target="_blank">算法图示</a>
        </li>
    </ul>
  </div>

      </div>
        <div class="back-to-top motion-element">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">陈孟辉</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
    <span title="站点总字数">204k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">3:06</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>

<script src="/js/utils.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : true,
      notify     : true,
      appId      : '9jQqXQuURk2dvsv5oVh9D0VM-gzGzoHsz',
      appKey     : 'YfjrSNHQAtj63yeNmdmrLlLw',
      placeholder: "Just go go",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : false,
      lang       : '' || 'zh-cn',
      path       : location.pathname,
      recordIP   : true,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
